import { combineReducers } from 'redux'

function filter(state = false, action) {
	switch (action.type) {
		case 'filter':
			return action.filter
		default:
			return state
	}
}

function todos(state = [{text:'foo'}], action) {
	switch (action.type) {
		case 'addToDo':
			return [...state, {text: action.text, done: false}]
		default:
			return state
	}
}

const todoApp = combineReducers({filter, todos})

export default todoApp

